package common

import (
	"gitee.com/igolang/imoney/internal/app/common/controllers"
	"gitee.com/igolang/imoney/internal/core"
	"gitee.com/igolang/imoney/internal/core/logger"
	"gitee.com/igolang/imoney/internal/router"
	"github.com/gin-gonic/gin"
)

type commonModule struct {
}

func init() {
	core.AddService(&commonModule{})
}

func (m *commonModule) Router(engin *gin.Engine) {
	logger.Log().Debug("init common modules")
	g := engin.Group("common")
	g.GET("profile/*filename", controllers.Profile.Profile)
}

func (m *commonModule) Init() error {
	router.Add(m.Router)
	return nil
}

func (m *commonModule) Shutdown() error {
	return nil
}

func (m *commonModule) Name() string {
	return "common module"
}
